package com.edu.exam.enums.examination;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 扫描设备类型枚举
 */
@Getter
@AllArgsConstructor
public enum ScannerDeviceType {
    FLATBED("FLATBED", "平板扫描仪"),
    SHEET_FED("SHEET_FED", "馈纸式扫描仪"),
    PORTABLE("PORTABLE", "便携式扫描仪"),
    DRUM("DRUM", "鼓式扫描仪"),
    OVERHEAD("OVERHEAD", "平台扫描仪"),
    SLIDE("SLIDE", "幻灯片扫描仪"),
    MICROFICHE("MICROFICHE", "缩微胶片扫描仪"),
    BOOK("BOOK", "书本扫描仪"),
    MULTIFUNCTION("MULTIFUNCTION", "多功能一体机"),
    NETWORK("NETWORK", "网络扫描仪"),
    MOBILE("MOBILE", "移动扫描设备");

    private final String code;
    private final String description;

    public static ScannerDeviceType fromCode(String code) {
        for (ScannerDeviceType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return FLATBED; // 默认返回平板扫描仪
    }
}